﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharePointSearchBench.Library
{
    /// <summary>
    /// A core class used for encapsulating the text of Keyword or Full Text searches.
    /// </summary>
    /// <example>
    /// <code>
    /// string text "SELECT Title, Author FROM Scope() " +
    ///     "WHERE FREETEXT(DEFAULTPROPERTIES, 'test') " +
    ///     "ORDER BY Rank DESC");
    /// SearchText s = new SearchText(s);
    /// Search search = new Search();
    /// search.SearchText = s;
    /// </code>
    /// </example>
    public class SearchText
    {
        string text;

        /// <summary>
        /// Creates an empty instance.
        /// </summary>
        public SearchText()
        {
            this.text = string.Empty;
        } 

        /// <summary>
        /// Creates an instance of the class with a literal query.
        /// </summary>
        /// <param name="text"></param>
        public SearchText(string text)
        {
            this.text = text;
        }

        /// <summary>
        /// Returns the literal query.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return this.text;
        }
    }
}
